
	function createMyActivity(){
		
		var activityStore=CRM.commons.createStore('activityStoreId', CRM.SPComp.activityDataArray, 'searchactivities/showActivitiesByUser');
		
		var grid = CRM.commons.createGrid('myActivitiesGrid', activityStore, CRM.SPComp.createActivityColumnModel());
		grid.setHeight(400);
		var resultPanel = new Ext.Panel({
			id		: 'resultPanel',
			title	: 'Appointments & Activities',
			width	: 'fix',
			height	: 450,
			items	: [grid]
		});
		
		
		
		var rootPanel = new Ext.Panel({
			id		: 'rootPanel',
			width	: 1085,
			height	: 480,
			//padding	: '5px',
			items	: [resultPanel],
			tbar	: {
			    	   	xtype	: 'toolbar',
			    	   	items	: {
					    	   		xtype	: 'tbbutton',
					    	   		text	: 'Show Activities By',
					    	   		menu	: [
					    	   		    	   {
					    	   		    		   text 	: 'Day',
					    	   		    		   group	: 'filter',
					    	   		    		   checked	: false,
					    	   		    		   handler	: function(){
					    	   		    			   			reloadMyActivity(grid, 'day');
					    	   		    		   			  }
					    	   		    	   },
					    	   		    	   {
					    	   		    		   text 	: 'Week',
					    	   		    		   group	: 'filter',
					    	   		    		   checked	: false,
					    	   		    		   handler	: function(){
					    	   		    			   			reloadMyActivity(grid, 'week');
					    	   		    		   			  }	   
					    	   		    	   },
					    	   		    	   {
					    	   		    		   text 	: 'Month',
					    	   		    		   group	: 'filter',
					    	   		    		   checked	: false,
					    	   		    		   handler	: function(){
					    	   		    			   			reloadMyActivity(grid, 'month');
					    	   		    		   			  }
					    	   		    	   }
					    	   		    	  ]
			    	   			  }
					  }
		});

		return rootPanel;
	}
	
	function reloadMyActivity(grid, criteriaValue){
		grid.store.removeAll();
   		grid.store.reload({
   				 params : {
   					 		searchBy : criteriaValue
   				 		  }
   			 });
	}
	
